<?php
// UPDATE
// td1
$colTxt = "cv = 1.0, cvi = 0, reject = 0, withdraw = 0, cost = 20.0, wholesale = 100.0, retail = 0, seller_id = 17896, span = 4, date = '2013-12-18', hour = 18, summary_type = 11, site_id = 8 ";
$cols = explode(',', $colTxt);

$cnt = count($cols);
for ($i = 0; $i < $cnt; $i++) {
	$k_v = explode('=', $cols[$i]);
	$td1 = $td1 . "$k_v[0]: $k_v[1]<br>";
  }
   // where
$td1 = $td1. '<b>Where</b><br>';
$colTxt = "terminal_type = 1 AND seller_id = 17896 AND site_id = 8 AND summary_id = 58";
$cols = explode('AND', $colTxt);

$cnt = count($cols);
for ($i = 0; $i < $cnt; $i++) {
	$k_v = explode('=', $cols[$i]);
	$td1 = $td1 . "$k_v[0]: $k_v[1]<br>";
}

// td2
$colTxt = "cv = 1.0, cvi = 0, reject = 0, withdraw = 0, cost = 20.0, wholesale = 100.0, retail = 0, seller_id = 17896, span = 4, date = '2013-12-18', hour = 18, summary_type = 12, site_id = 8";
$cols = explode(',', $colTxt);

$cnt = count($cols);
for ($i = 0; $i < $cnt; $i++) {
	$k_v = explode('=', $cols[$i]);
	$td2 = $td2 . "$k_v[0]: $k_v[1]<br>";
  }
   // where
$td2 = $td2. '<b>Where</b><br>';
$colTxt = "terminal_type = 1 AND seller_id = 17896 AND site_id = 8 AND item_id = 0 AND summary_id = 57";
$cols = explode('AND', $colTxt);

$cnt = count($cols);
for ($i = 0; $i < $cnt; $i++) {
	$k_v = explode('=', $cols[$i]);
	$td2 = $td2 . "$k_v[0]: $k_v[1]<br>";
}

echo "<table border='0'>";
	echo "<tr>";
		echo "<td>";
			echo "<b>summary_site_hour</b><br>";
			echo $td1;
		echo "</td>";
		echo "<td style='padding-left: 20'>";
			echo "<br><b>summary_item_hour</b><br>";
			echo $td2;
		echo "</td>";
	echo "</tr>";
echo "</table>";



